package com.shop.domain.system;

import java.util.Date;
import java.math.BigDecimal;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.*;
import javax.persistence.Table;
import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.jpa.support.JpaConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;

/**
 * <p>SystemUserLevel 实体类</p>
 * <p>Table: t_system_user_level - 设置用户等级表</p>
 * @author generator
 * @date 2021-02-27 06:50:42
 */
@ApiModel("SystemUserLevel 实体类")
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "t_system_user_level")
@SQLDelete(sql = "update t_system_user_level set is_deleted = 1 where id = ?")
@Where(clause = JpaConst.WHERE_CLAUSE_NOT_DELETED)
@DynamicInsert(true)
@DynamicUpdate(true)
public class SystemUserLevel extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
	@JSONField(serialize=false)
    private Long id;

    /**
	 * 商户id
	 */
    @ApiModelProperty("商户id")
	@Column(name = "mer_id")
    private Integer merId;

    /**
	 * 会员名称
	 */
    @ApiModelProperty("会员名称")
	@Column(name = "name")
    private String name;

    /**
	 * 购买金额
	 */
    @ApiModelProperty("购买金额")
	@Column(name = "money")
    private BigDecimal money;

    /**
	 * 有效时间
	 */
    @ApiModelProperty("有效时间")
	@Column(name = "valid_date")
    private Integer validDate;

    /**
	 * 是否为永久会员
	 */
    @ApiModelProperty("是否为永久会员")
	@Column(name = "is_forever")
    private Integer isForever;

    /**
	 * 是否购买,1=购买,0=不购买
	 */
    @ApiModelProperty("是否购买,1=购买,0=不购买")
	@Column(name = "is_pay")
    private Integer isPay;

    /**
	 * 是否显示 1=显示,0=隐藏
	 */
    @ApiModelProperty("是否显示 1=显示,0=隐藏")
	@Column(name = "is_show")
    private Integer isShow;

    /**
	 * 会员等级
	 */
    @ApiModelProperty("会员等级")
	@Column(name = "grade")
    private Integer grade;

    /**
	 * 享受折扣
	 */
    @ApiModelProperty("享受折扣")
	@Column(name = "discount")
    private BigDecimal discount;

    /**
	 * 会员卡背景
	 */
    @ApiModelProperty("会员卡背景")
	@Column(name = "image")
    private String image;

    /**
	 * 会员图标
	 */
    @ApiModelProperty("会员图标")
	@Column(name = "icon")
    private String icon;

    /**
	 * 说明
	 */
    @ApiModelProperty("说明")
	@Column(name = "explain")
    private String explain;

    /**
	 * 直推收益比例/百分比
	 */
    @ApiModelProperty("直推收益比例/百分比")
	@Column(name = "direct_proportion")
    private Integer directProportion;

    /**
	 * 间推收益比例
	 */
    @ApiModelProperty("间推收益比例")
	@Column(name = "indirect_proportion")
    private Integer indirectProportion;

    /**
	 * 团队收益比例/百分比
	 */
    @ApiModelProperty("团队收益比例/百分比")
	@Column(name = "team_proportion")
    private Integer teamProportion;

    /**
	 * 寄售返利比例
	 */
    @ApiModelProperty("寄售返利比例")
	@Column(name = "consignment")
    private BigDecimal consignment;

    /**
	 * 创建时间
	 */
    @ApiModelProperty("创建时间")
	@Column(name = "create_time")
    private Date createTime;

    /**
     * 休眠天数
     */
    @ApiModelProperty("休眠天数")
    @Column(name = "sleep_day")
    private Integer sleepDay;

    /**
	 * 修改时间
	 */
    @ApiModelProperty("修改时间")
	@Column(name = "update_time")
    @JSONField(serialize=false)
    private Date updateTime;

    /**
	 * 是否删除
	 */
    @ApiModelProperty("是否删除")
	@Column(name = "is_deleted")
    @JSONField(serialize=false)
    private Integer isDeleted;
}